#pragma once

#include "pch.h"
#include <GameState.h>
#include <DirectXHelper.h>

class SenzibleGame
{
public:	
	SenzibleGame();

	void Start(GameState* initialState);	

	bool IsClosed;
	bool IsVisible;

	// Direct3D Objects.
	Microsoft::WRL::ComPtr<ID3D11Device1> D3dDevice;
	Microsoft::WRL::ComPtr<ID3D11DeviceContext1>D3dContext;
	Microsoft::WRL::ComPtr<IDXGISwapChain1> SwapChain;
	Microsoft::WRL::ComPtr<ID3D11RenderTargetView> RenderTargetView;
	Microsoft::WRL::ComPtr<ID3D11DepthStencilView> DepthStencilView;

	// Cached renderer properties.
	D3D_FEATURE_LEVEL FeatureLevel;
	Windows::Foundation::Size RenderTargetSize;
	Windows::Foundation::Rect WindowBounds;
	Platform::Agile<Windows::UI::Core::CoreWindow> Window;
	Windows::Graphics::Display::DisplayOrientations Orientation;

	// Transform used for display orientation.
	DirectX::XMFLOAT4X4 OrientationTransform3D;

private:
	GameState* CurrentGameState;

	void Initialize(Windows::UI::Core::CoreWindow^ window);
	void CreateDeviceResources();
	void CreateWindowSizeDependentResources();
	void Present();

	void HandleDeviceLost();
	virtual float ConvertDipsToPixels(float dips);
};

